---@class GT.ui.model.loding 系统加载
GT.ui.model.loding = class()

function GT.ui.model.loding:ctor()
    self.ui = {}

    self.prefab = {}
    self.prefab["系统加载"] = GT.ui.prefab.obj({
        module = "87aa3c75-c556-4a89-8bcc-1c172f88e118",
        parent = "panel_2",
    })

    local p = self.prefab["系统加载"]

    self.ui["self"] = p:child(GT.ui.control.image, "系统加载")
    self.ui["self"].binding.z_order=9999
    self.ui["loding"] = p:child(GT.ui.control.progress, "loding")
    self.ui["text"] = p:child(GT.ui.control.label, "loding.text")
    
end

---@param max number
function GT.ui.model.loding:set_max(max)
    self.ui["loding"].binding.max_value=max
end

---@param cur number
function GT.ui.model.loding:set_cur(cur)
    self.ui["loding"].binding.bar = {
        progress = cur,
        time =0
    }
end

---@param txt string
function GT.ui.model.loding:set_text(txt)
    self.ui["text"].binding.text = txt
end

function GT.ui.model.loding:hide()
    self.ui["self"].binding.show=false
end